// by Xeno
private ["_officer", "_newgroup", "_poss", "_fortress", "_bpos", "_leader"];
#include "x_setup.sqf"

x_sm_pos = [[1265.9064,1618.1653,0], [1365.9064,1518.1653,0]]; // index: 12,   Officer in Kamyshovo
x_sm_type = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client) then {
	d_current_mission_text = "Intel reports a high-ranking enemy officer is at his home outside Wietze. Eliminate him.";
	d_current_mission_resolved_text = "Good job. The enemy officer is dead.";
};

if (isServer) then {
	_officer = switch (d_enemy_side) do {
		case "EAST": {"RU_Commander"};
		case "WEST": {"USMC_Soldier_Officer"};
		case "GUER": {"GUE_Commander"};
	};
	__PossAndOther
	["shilka", 0, "bmp", 1, "tank", 0, _pos_other,1,0] spawn XCreateArmor;
	sleep 2.123;
	__GetEGrp(_newgroup)
	_sm_vehicle = _newgroup createUnit [_officer, _poss, [], 0, "FORM"];
	_sm_vehicle setVariable ["BIS_noCoreConversations", true];
	__addDead(_sm_vehicle)
	_fortress = "Land_Fort_Watchtower" createVehicle _poss;
	_fortress setDir 180;
	__AddToExtraVec(_fortress)
#ifndef __TT__
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetNormal}];
#else
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetTT}];
#endif
	sleep 2.123;
	_bpos = position _fortress;
	_sm_vehicle setPos _bpos;
	sleep 2.123;
	_leader = leader _newgroup;
	_leader setRank "COLONEL";
	_newgroup allowFleeing 0;
	_newgroup setbehaviour "AWARE";
	_leader disableAI "MOVE";
	sleep 2.123;
	["specops", 0, "basic", 4, _poss,0] spawn XCreateInf;
};